<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620" />
<title>Booking</title>
<link rel="stylesheet" href="http://localhost/RestEasyHotel/css/styles.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="http://localhost/RestEasyHotel/css/jquery-ui-1.8.14.custom.css" type="text/css" media="screen, projection">
<script src="http://localhost/RestEasyHotel/js/jquery-1.6.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://localhost/RestEasyHotel/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
function validate() {
	if(document.form1.fname.value==''){
		alert("Firstname value is missing !");
		return false;
	}else if(document.form1.lname.value==''){
		alert("Lastname value is missing !");
		return false;
	}else if(document.form1.email.value==''){
		alert("E-mail value is missing !");
		return false;
	}else if(document.form1.tel.value==''){
		alert("Phone no. value is missing !");
		return false;
	}else if(document.form1.address.value==''){
		alert("Address value is missing !");
		return false;
	}else if(document.form1.credit.value==''){
		alert("Credit-card value is missing !");
		return false;
	}else{
		return true;
	}
}
</script>
<script type="text/javascript">
	$(document).ready(function(){
		$('#booking').click(function(){
			$.ajax({
				url: "<?php echo base_url(); ?>index.php/Customer/keep_booking/<?php echo $branch."/".$date."/".$night."/".$rooms ?>",
				type: 'post',
				data: {'fname': $('#fname').val(), 'lname' : $('#lname').val(), 'address' : $('#address').val(), 'email' : $('#email').val(), 'tel' : $('#tel').val(), 'credit' : $('#credit').val()},
				success: function(data){
					alert("Success: "+data);
					window.location="<?php echo base_url(); ?>index.php/Customer/";
				}
			});
		});
	});
</script>
</head>

<div id="container"><!--start #container-->
    
   		<div id="navigation"><!--start #navigation-->
        <ul>
        <li><a href="index.html">home</a></li>
        <li><a href="#">accommodation</a></li>
        <li><a href="#">facilities</a></li>
        <li><a href="#">contact us</a></li>
        
        <li>
        <form action="" class="form" method="get">
        
        <div id="search-left">
        </div>
        
        <input type="text" class="search-field" value="Search" size="25" />
        
        <div id="search-right">
        </div>
        
        <input name="submit" type="image" src="http://localhost/RestEasyHotel/images/search_btn.png" class="searc-btn" value="GO!"/>
        
        </form>
        
        </li>
        
        </ul>
        </div><!-- end #navigation-->
        
        <div id="title"><!--start #title-->
        </div><!--end #title-->
        
            <table width="850px" style="border-collapse: collapse;">
            	<tr height="88px">
                    <td colspan="4" align="center" style="background-image:url(http://localhost/RestEasyHotel/images/footer.png); background-repeat:no-repeat; width:850px;">
                	<h1>Bill</h1>
                    </td>
                </tr>
                <tr>
                	<td colspan="4" align="center">&nbsp;</td>
                </tr>
                <tr align="center">
                    <td width="25%">
                        <h3>Room</h3>
                    </td>
                    <td width="25%">
                        <h3>amount of rooms</h3>
                    </td>
                    <td width="25%">
                        <h3>amount of days</h3>
                    </td>
                    <td width="25%">
                        <h3>price/room/day</h3>
                    </td>
                </tr>
                <tr>
                	<td colspan="4" align="center">&nbsp;</td>
                </tr>
                <tr>
                    <td width="25%" align="center">
                        <h4>regular room</h4>
                    </td>
                    <td width="25%" align="center">
                        <h3><?php echo $rooms; ?></h3>
                    </td>
                    <td width="25%" align="center">
                        <h3><?php echo $night; ?></h3>
                    </td>
                    <td width="25%" align="center">
                        <h3>200</h3>
                    </td>
                </tr>
                <tr>
                	<td colspan="4" align="center">&nbsp;</td>
                </tr>
                <tr height="50px;">
                	<td colspan="3"></td>
                    <td align="right" style="padding-right:70px; background-image:url(http://localhost/RestEasyHotel/images/total_but.png); background-position:center; background-repeat:no-repeat;">
                        <font color="#FF0000"><h2><?php echo $rooms*$night*200; ?></h2></font>
                    </td>
                </tr>
            </table>
            <br/>
            <form name="form1" action="<?php echo base_url(); ?>index.php/Customer/booking" onsubmit="return validate();" method="post">
                <table border"0" width="850px" style="border-collapse: collapse;">
                    <tr height="88px">
                        <td colspan="4" align="center" style="background-image:url(http://localhost/RestEasyHotel/images/footer.png); background-repeat:no-repeat; width:850px;">
                        <h1>Customer Booking</h1>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">&nbsp;
                        
                        </td>
                    </tr>
                    <tr align="center">
                        <td width="25%">
                            <h3>Firstname</h3>
                        </td>
                        <td width="25%">
                        	<div id="search-left">
                            </div>
                            
                            <input type="text" class="search-field" size="25" id="fname" name="fname" />
                            
                            <div id="search-right">
                            </div>
                        </td>
                        <td width="25%">
                            <h3>Lastname</h3>
                        </td>
                        <td width="25%">
                            <div id="search-left">
                            </div>
                            
                            <input type="text" class="search-field" size="25" id="lname" name="lname" />
                            
                            <div id="search-right">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">&nbsp;
                        
                        </td>
                    </tr>
                    <tr align="center">
                        <td width="25%">
                            <h3>E-mail</h3>
                        </td>
                        <td width="25%">
                            <div id="search-left">
                            </div>
                            
                            <input type="text" class="search-field" size="25" id="email" name="email" />
                            
                            <div id="search-right">
                            </div>
                        </td>
                        <td width="25%">
                            <h3>Phone no.</h3>
                        </td>
                        <td width="25%">
                            <div id="search-left">
                            </div>
                            
                            <input type="text" class="search-field" size="25" id="tel" name="tel" />
                            
                            <div id="search-right">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">&nbsp;
                        
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <h3>Address</h3>
                        </td>
                        <td colspan="3" align="center">
                            <div id="search-left">
                            </div>
                            
                            <input type="text" class="search-field" size="50" id="address" name="address" />
                            
                            <div id="search-right">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">&nbsp;
                        
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <h3>Credit-card</h3>
                        </td>
                        <td colspan="3" align="center">
                            <div id="search-left">
                            </div>
                            
                            <input type="text" class="search-field" size="25" id="credit" name="credit" />
                            
                            <div id="search-right">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">&nbsp;
                        
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <img id="booking" src="http://localhost/RestEasyHotel/images/booking.png" />
                            <img id="reset" src="http://localhost/RestEasyHotel/images/reset.png" />
                        </td>
                    </tr>
                </table>
            </form>
			
            
            <div id="footer"><!--start #footer-->
        		<p>Copyright &copy; resteasyhotel.com| All Right Reserverd- Design By JASOND</p>
      	    </div><!--end #footer-->


</body>
</html>
